package com.hzsun.nacos.boot.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
public class ConfigController {

    @Value("${useLocalCache:false}")
    private boolean useLocalCache;

    @Value("${user.age:false}")
    private String  age;
    @Value("${user.names:false}")
    private String  names;

    /**
     * http://localhost:8080/config/get
     */
    @RequestMapping("/get")
    public boolean get() {
        return useLocalCache;
    }

    @RequestMapping("/age")
    public String getAge() {
        return age;
    }

    @RequestMapping("/name")
    public String getName() {
        return names;
    }
}